package org.example.ffmmx.bmapandroid;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;

public class DemoLoginActivity extends ActionBarActivity {
    private Button loginBtn, forgotPwdBtn;
    private LinearLayout loginForm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_demo_login);
        loginBtn= (Button) findViewById(R.id.loginBtn);
        forgotPwdBtn = (Button) findViewById(R.id.forgotPwdBtn);

        loginForm= (LinearLayout) findViewById(R.id.loginForm);

        LoginFormButtonClickListener clickListener=new LoginFormButtonClickListener();
        loginBtn.setOnClickListener(clickListener);
        forgotPwdBtn.setOnClickListener(clickListener);

    }

    private class LoginFormButtonClickListener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.loginBtn:
                    Intent intent=new Intent();
                    intent.setClass(getApplicationContext(),DemoMainActivity.class);
                    startActivity(intent);
                    break;
                case R.id.forgotPwdBtn:
                    Toast.makeText(getApplicationContext(),"暂时为实现",Toast.LENGTH_SHORT).show();
                    break;
                default:
                    break;
            }
        }
    }
}
